<?php
namespace app\common\controller;
use framework\ext\Check;

class IndexController extends \app\base\controller\AdminController{

    //模板列表
    public function config(){
        if($this->isPost()){
            $name  = form('post.name');
            $value = form('post.value');
            switch ($name) {          
                case 'upfolder':
                    $rel = save_config('common',array('UP_FOLDER'=>$value));
                    break;
                case 'upsize':
                    $rel = save_config('common', array('UP_SIZE'=>$value));
                    break;
                case 'upexts':
                    $rel = save_config('common', array('UP_EXTS'=>$value));
                    break;
                default:
                    $rel = FALSE;
                    break;
            }
            echo "修改成功";
        }else{
            $this->config = config('common');
            $this->display();  
        }

    } 
}